package com.wunong.smart.commission;

import com.wunong.smart.commission.client.service.CommissionReadService;
import com.wunong.smart.commission.client.service.CommissionWriteService;
import com.wunong.smart.commission.domain.business.CancelCommissionBusinessExt;
import com.wunong.smart.commission.domain.business.CreateCommissionBusinessExt;
import com.wunong.smart.commission.domain.business.FinishCommissionBusinessExt;
import com.wunong.smart.commission.domain.business.impl.DefaultCancelCommissionBusinessExt;
import com.wunong.smart.commission.domain.business.impl.DefaultCreateCommissionBusinessExt;
import com.wunong.smart.commission.domain.business.impl.DefaultFinishCommissionBusinessExt;
import com.wunong.smart.commission.service.impl.CommissionReadServiceImpl;
import com.wunong.smart.commission.service.impl.CommissionWriteServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author create by zealot.zt
 */
@Configuration
public class CommissionBizConfiguration {

    @ConditionalOnMissingBean(CommissionReadService.class)
    @Bean
    public CommissionReadService defaultCommissionReadService() {
        return new CommissionReadServiceImpl();
    }

    @ConditionalOnMissingBean(CommissionWriteService.class)
    @Bean
    public CommissionWriteService defaultCommissionWriteService() {
        return new CommissionWriteServiceImpl();
    }

    @ConditionalOnMissingBean(CreateCommissionBusinessExt.class)
    @Bean
    public CreateCommissionBusinessExt defaultCreateCommissionBusinessExt() {
        return new DefaultCreateCommissionBusinessExt();
    }

    @ConditionalOnMissingBean(CancelCommissionBusinessExt.class)
    @Bean
    public CancelCommissionBusinessExt defaultCancelCommissionBusinessExt() {
        return new DefaultCancelCommissionBusinessExt();
    }

    @ConditionalOnMissingBean(FinishCommissionBusinessExt.class)
    @Bean
    public FinishCommissionBusinessExt defaultFinishCommissionBusinessExt() {
        return new DefaultFinishCommissionBusinessExt();
    }

}
